﻿using System;

namespace RedisDotNet
{
    public static class DateTimeExtensions
    {
        static readonly DateTime unixEpoch = new DateTime(1970, 1, 1);

        public static long ToUnixTimeStamp(this DateTime dateTime)
        {
            return Convert.ToInt64((unixEpoch - dateTime).TotalSeconds);
        }
    }
}
